Enforce agreeing toolchain pins across the conda envs - #756
Open
harrism wants to merge 1 commit into
Open
Conversation
env/ holds several conda environments that each pin python, cuda-version and
pytorch-gpu independently, with nothing keeping them in agreement. They agree
today (3.12 / 13.0 / 2.13.0), which is coincidence rather than a guarantee.
A disagreement is not cosmetic. build_environment.yml is the environment the
wheel is compiled in, so it fixes the ABI: a developer working from a different
env file with a different PyTorch would build or load a wheel against a
mismatched libtorch and get an undefined-symbol ImportError at `import fvdb`.
fvdb-reality-capture also derives its benchmark environment from
build_environment.yml, so a disagreement here leaves "which PyTorch does
fvdb-core use?" without a single answer.
Add a codestyle job enforcing the rule, following the existing
check_runner_token_policy.py precedent for CI policy scripts:
If two environment files pin the same key, they must pin the same value.
The rule is permissive about presence and strict about agreement, so a file may
omit a key -- release_base_environment.yml pins none of them -- and adding a
slimmer environment does not require touching the script.
--fix propagates build_environment.yml's values to the others, so bumping a
version stays a one-file edit plus one command.
This is entirely in-repo, so unlike a cross-repo gate it cannot deadlock: the
fix belongs in the same PR that breaks it. Nine unit tests cover agreement,
omitted keys, disagreement on each key, surgical --fix, and the error paths.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
env/holds several conda environments that each pinpython,cuda-versionandpytorch-gpuindependently, with nothing keeping them in agreement:build_environment.ymldev_environment.ymllearn_environment.ymltest_environment.ymlrelease_base_environment.ymlThey agree today, but that's coincidence, not a guarantee — four files have to be edited in lockstep by hand on every bump.
A disagreement wouldn't be cosmetic.
build_environment.ymlis the environment the wheel is compiled in, so it fixes the ABI: someone working from a different env file with a different PyTorch builds or loads a wheel against a mismatched libtorch and gets an undefined-symbolImportErroratimport fvdb— the same failure that broke fvdb-reality-capture's nightly three times across repos. fvdb-reality-capture also derives its benchmark environment frombuild_environment.yml(frc#319), so a disagreement here leaves "which PyTorch does fvdb-core use?" without a single answer.Change
A codestyle job enforcing:
The rule is permissive about presence and strict about agreement — a file may omit a key (
release_base_environment.ymlpins none), so adding a slimmer environment later doesn't require touching the script.--fixpropagatesbuild_environment.yml's values to the others, keeping a version bump to a one-file edit plus one command:Follows the existing
check_runner_token_policy.pyprecedent: policy script in.github/scripts/, companion pytest file, both run from the workflow.Why this shape
This replaces #746 (closed), which tried to gate fvdb-core PRs against fvdb-reality-capture's pins. That was cross-repo and awkward — it needed a label escape hatch and a companion-PR search precisely because the fix lived in another repository and couldn't merge in the same commit.
This check is entirely in-repo, so it cannot deadlock: whatever breaks it is fixed in the same PR. No token, no label, no cross-repo API call.
Testing
Nine unit tests cover agreement, omitted keys, disagreement on each of the three keys, surgical
--fix(unrelated content preserved), and both error paths. Verified against the realenv/directory: passes as-is, exits 1 with a per-key breakdown when a pin is broken, and--fixrestores it.🤖 Generated with Claude Code